<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!doctype html>
<%
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort();
%>
<html>
<head>
    <%@ include file="/common/common.jsp" %>
    <link rel="stylesheet" type="text/css" href="../statics/aui/css/aui.css"/>
    <link rel="stylesheet" type="text/css" href="${ctx }/css/weui.min.css"/>
    <link rel="stylesheet" type="text/css" href="${ctx }/css/jquery-weui.css"/>
    <script type="text/javascript" src="../js/login.js"></script>
    <script type="text/javascript" src="../js/zepto.min.js"></script>
    <script type="text/javascript" src="../js/touch.js"></script>
    <title>用户管理</title>
    <style type="text/css">
        .weui-uploader__file {
            width: 160px;
            height: 160px;
        }

        .weui-gallery {
            webkit-touch-callout: default;
            cursor: pointer;
        }

        .weui-gallery__img {
            background-size: initial;
        }
    </style>
</head>

<body>

<div class="aui-content aui-margin-b-15">
    <ul class="aui-list aui-media-list">
        <li class="aui-list-item aui-list-item-middle">
            <div class="aui-media-list-item-inner">
                <div class="aui-list-item-media" style="width: 3rem;">
                    <img onerror="this.src='../statics/aui/images/dpmt.png'"
                         src="${wechat.headimgurl}" class="aui-img-round aui-list-img-sm">
                </div>
                <input type="hidden" id="openid" value="${openid}" name="openid">
                <div class="aui-list-item-inner  ">
                    <table style="width: 100%">
                        <tr>
                            <td colspan="2">微信昵称:${wechat.nickname}</td>
                        </tr>
                        <tr>
                            <td colspan="2">商户号：${merchant.merchantNo}</td>
                        </tr>
                        <tr>
                            <td colspan="2">所属单位：${merchant.shopname}</td>
                        </tr>

                        <tr>
                            <td style="width: 60px;">
                                <c:choose>
                                    <c:when test="${cashiers.role==1}">
                                        <img src="../statics/aui/images/gly.png" style="width: 60px; height: 20px;">
                                    </c:when>
                                    <c:otherwise>
                                        <img src="../statics/aui/images/sky.png" style="width: 60px; height: 20px;">
                                    </c:otherwise>
                                </c:choose>
                            </td>
                            <td>
                                <c:if test="${cashiers.activateState==1}">
                                    <img style="width: 60px; height: 20px;" alt=""
                                         src="../statics/aui/images/yrz.png">
                                </c:if>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </li>
    </ul>
</div>


<div style="margin-left: 5px;"></div>
<div class="aui-content aui-margin-b-15">
    <ul class="aui-list aui-media-list">
        <li class="aui-list-item aui-list-item-middle"
            onclick="location='${ctx}/trading/center'">
            <div class="aui-media-list-item-inner">
                <div class="aui-list-item-media" style="width: 2rem;">
                    <img src="../statics/aui/images/yggl.png">
                </div>
                <div class="aui-list-item-inner aui-list-item-arrow " style="padding-top: 17px">交易中心</div>
            </div>
        </li>
    </ul>
</div>

<div style="margin-left: 5px;"></div>
<div class="aui-content aui-margin-b-15">
    <ul class="aui-list aui-media-list">
        <li class="aui-list-item aui-list-item-middle"
            onclick="location='${ctx}/auth/fixedMoneyQRCode'">
            <div class="aui-media-list-item-inner">
                <div class="aui-list-item-media" style="width: 2rem;">
                    <img src="../statics/aui/images/skewm.png">
                </div>
                <div class="aui-list-item-inner aui-list-item-arrow " style="padding-top: 17px">固额二维码生成</div>
            </div>
        </li>
    </ul>
</div>
<c:if test="${cashiers.role==1}"><!--商户进入-->
<div class="aui-content aui-margin-b-15">
    <ul class="aui-list aui-media-list">
        <li class="aui-list-item aui-list-item-middle"
            onclick="location='${ctx}/auth/viewQRCode'">
            <div class="aui-media-list-item-inner">
                <div class="aui-list-item-media" style="width: 2rem;">
                    <img src="../statics/aui/images/skewm.png">
                </div>
                <div class="aui-list-item-inner aui-list-item-arrow " style="padding-top: 17px">二维码管理</div>
            </div>
        </li>
    </ul>
</div>
</c:if>

<c:if test="${cashiers.role==1}">
    <div style="margin-left: 5px;"></div>
    <div class="aui-content aui-margin-b-15">
        <ul class="aui-list aui-media-list">

            <li class="aui-list-item aui-list-item-middle"
                onclick="location='${ctx}/auth/viewCashierList'">
                <div class="aui-media-list-item-inner">
                    <div class="aui-list-item-media" style="width: 2rem;">
                        <img src="../statics/aui/images/yggl.png">
                    </div>
                    <div class="aui-list-item-inner aui-list-item-arrow " style="padding-top: 17px">收款员管理</div>
                </div>
            </li>
        </ul>
    </div>
</c:if>


<div id="imgView" class="page__bd">
    <div class="weui-gallery" id="gallery">
        <img class="weui-gallery__img" id="galleryImg"></img>
    </div>

    <div style="margin-left: 5px;"></div>
    <c:if test="${cashiers.role==2}"><!--收款员进入-->
    <div class="aui-content aui-margin-b-15">
        <ul class="aui-list aui-media-list">
            <li class="aui-list-item aui-list-item-middle"
                onclick="">
                <div class="aui-media-list-item-inner">
                    <div class="aui-list-item-media" style="width: 2rem;">
                        <img src="../statics/aui/images/skewm.png">
                    </div>
                    <div class="aui-list-item-inner  " style="padding-top: 17px">我的二维码</div>
                </div>
            </li>
        </ul>


        <div class="weui-cells weui-cells_form">
            <div class="weui-cell">
                <div class="weui-cell__bd">
                    <div class="weui-uploader">
                        <div class="weui-uploader__bd">
                            <ul class="weui-uploader__files" id="uploaderFiles">
                                <c:if test="${codeList == null}">
                                    <div align="center" style="font-size: 0.6rem;color: #757575;">暂无二维码</div>
                                </c:if>
                                <c:forEach items="${codeList}" var="code" varStatus="status">
                                    <img class="weui-uploader__file imgPhoto" id="${code.codeNo}"
                                         style="background-image:url(${ctx}/lookqrNewCode?codeNo=${code.codeNo})"
                                         src="${ctx}/lookqrNewCode?codeNo=${code.codeNo}" width="120" height="120">
                                </c:forEach>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>

            <%--
<c:forEach items="${codeList}" var="code" varStatus="status" >
 <div style="margin-left: 20px;float: left">
                    <div align="center" style="margin-top: 10px;">${code.codeName}</div>
                    <div align="center" style="margin-top: 5px;" >${code.codeNo}</div>
                    <div style="margin-top: 0px;">
                    <img   style="cursor: pointer;" src="${ctx}/lookqrNewCode?codeNo=${code.codeNo}"
                    width="160" height="160" ></div>
                </div>
                </c:forEach> --%>
    </div>
    </c:if>

</div>

<div style="margin-left: 5px;"></div>

<div class="aui-content aui-margin-b-15">
    <ul class="aui-list aui-media-list">
        <li class="aui-list-item aui-list-item-middle"
            onclick="location='${ctx}/auth/viewMyAccount'">
            <div class="aui-media-list-item-inner">
                <div class="aui-list-item-media" style="width: 2rem;">
                    <img src="../statics/aui/images/account.png">
                </div>
                <div class="aui-list-item-inner aui-list-item-arrow " style="padding-top: 17px">我的账户</div>
            </div>
        </li>
    </ul>
</div>

<%--<section class="aui-content"
         style="margin-top: 14px; padding-left: 20px; padding-right: 20px;overflow-y:visible;overflow-x:visible">
    <p>
    <div class="aui-btn aui-btn-info  aui-btn-block" onclick="location='../auth/logout'">退出登录</div>
    </p>
</section>
<br/>--%>

<br/>
<br/>
<br/>
<%--
<footer class="aui-bar aui-bar-tab ">
    <div class="aui-bar-tab-item aui-border-r" tapmode
         style="width: 2rem;" onclick="location='../trading/center'">
        <div>
            <center>
                <img alt="" src="../statics/aui/images/jyzx.png">
            </center>
        </div>
        <div class="aui-bar-tab-label receivables_999999">交易中心</div>
    </div>
    <div class="aui-bar-tab-item" tapmode style="width: 2rem;" onclick="location='../auth/isMerchant'">
        <div>
            <center>
                <img alt="" src="../statics/aui/images/sjzxls.png">
            </center>
        </div>
        <div class="aui-bar-tab-label receivables_128ee9">商家中心</div>
    </div>
</footer>--%>
</body>


<script type="text/javascript">
    var tmpl = '<li class="weui-uploader__file" style="background-image:url(#url#)"></li>',
        $gallery = $("#gallery"), $galleryImg = $("#galleryImg"),
        $uploaderFiles = $("#uploaderFiles");

    $(function () {

        /* $uploaderFiles.on("click", "img", function(){
            $galleryImg.attr("src", this.getAttribute("src"));
            $gallery.fadeIn(100); 
        }); */

        /*  $gallery.on("click", function(){
        	$gallery.fadeOut(100);
        });  */


        Zepto('.imgPhoto').tap(function () {
            var codeNo = this.getAttribute("id");
            window.location.href = '${ctx}/auth/shareCode/' + codeNo;
            /* $galleryImg.attr("src", this.getAttribute("src"));
            url = this.getAttribute("src");
            $gallery.fadeIn(100);  */
        });

        Zepto('.imgPhoto').longTap(function () {
            return false;
        });

        Zepto('.weui-gallery').tap(function () {
            $gallery.fadeOut(100);

        });
        Zepto('.weui-gallery').longTap(function () {
            return false;
        });
    });


</script>

</html>


